.org 0xDF7AC ; Check Unit Type

Check_Unit_Type:
	
	MOV 	R1, 0x6C
	MUL		R2, R0, R1
	LDR 	R1, [Check_Unit_Type_1]
	LDRB	R1, [R1, R2]
	
	CMP		R1, Attack_Indirect				; Is Unit an Indirect?
	MOVCS	R0, Unit_Indirect_Combat		
	BXCS	LR
	
	CMP		R1, Attack_Direct				; Is Unit a Direct?
	MOVEQ	R0, Unit_Direct_Combat
	BXEQ	LR
	
	CMP		R0, Unit_Black_Bomb				; Is Unit a Black Bomb?
	BEQ		Unit_Type_Explode	
	
	CMP		R0, Unit_Oozium					; Is Unit an Oozium?
	BNE		Unit_Type_Transport

Unit_Type_Explode: 	
	MOV		R0, Unit_Explode				; Unit type is Explode
	BX		LR

Unit_Type_Transport: 		
	MOV		R0, Unit_Transport				; Unit type is Transport
	BX		LR
	
;-------------------------------------------------------------------------------		

Check_Unit_Type_1:
	.dw 0x022F4FCC